#include "game.hpp"
#include <GL/glew.h>

#ifndef GAMEINTERFACE_HPP
#define GAMEINTERFACE_HPP

class GameInterface{
private:
    bool viewChanged;
    bool endGame;

    Game *game;

    GLfloat squareSize;
    GLfloat selectionSize;
    GLfloat squareSpace;

    GLfloat *colorsTab;

    GLfloat *view;
    GLfloat *viewColors;

    int *checkBox;
    int selection;

    int viewEnd;
    int trianglesNum;
    int winTrianglesNum;
    int lineStripNum;

    void createSquare(GLfloat x, GLfloat y, GLfloat z, GLfloat size, GLfloat *result);
    void randColors();

    void reserveMemory();

    void createCheckBox();
    void createPlayerWin();
    void createPlayerLoose();

    void boardUp();
public:
    GameInterface(Game *game);

    void createDisplay();

    void addReply(int *ans);
    void addCheckToBoard();

    void interfaceReset();

    void selectNext();
    void selectPrev();

    void changeColor(int color);
    void colorNext();
    void colorPrev();

    //getters
    GLfloat *getView();
    GLfloat *getViewColors();

    int getViewSize();

    int getTrianglesNum();
    int getWinTrianglesNum();
    int getLineStripNum();

    int *getCheckBox();
};

#endif
